﻿@model S4Store.Models.Report.StoreChooserModel
@{
    Layout = null;
    ViewBag.Title = "StoreChooser";
}
<div style=" width:100%; height:30px; background:#E5EDEF">
    <div style=" padding:0 10px">
        <form action="@Url.Action(Model.Action,Model.Controller)">
        
        <table>
        <tr>
            <td>
            <div style=" display: inline-block">
            @if (Model.ShowStore)
            {
            <select class="storechooser" name="StoreId">
                @foreach (var store in Model.Stores)
                {
                    <option  value="@store.Id" @if (Model.Store != null && store.Id == Model.Store.Id)
                                               {<text>selected="selected"</text>}>@store.Name</option>
                }
            </select>
            }
            <select class="storechooser" name="Month">
                @for (DateTime dt=DateTime.Now;dt>DateTime.Now.AddYears(-3);dt=dt.AddMonths(-1))
                {
                    <option  value="@dt.ToString("yyyy-MM-01")" @if (dt.Year == Model.Month.Year&&dt.Month==Model.Month.Month)
                                                                {<text>selected="selected"</text>}>@dt.ToString("yyyy-MM")</option>
                }
            </select>
            </div>
            </td>
            <td>@Html.Raw(String.IsNullOrEmpty(Model.PlusItem) ? "" : Model.PlusItem)</td>
        </tr>
        </table>
        
        
        </form>
    </div>
</div>

